package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.qijian.maindata.domain.LineProcessItem;
import com.qijian.maindata.domain.query.LineBomQuery;
import com.qijian.maindata.domain.query.LineProcessItemQuery;
import com.qijian.maindata.domain.vo.LineProcessItemVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 物料需求Mapper接口
 *
 * @author qijian
 * @date 2021-11-10
 */
public interface LineProcessItemMapper extends BaseMapper<LineProcessItem> {

    @Select("select count(0)+IF(#{isAddOne},1,0) from main_line_process_item WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel(boolean isAddOne);

    List<LineProcessItemVo> selectProcessItemByBomId(@Param(Constants.WRAPPER) Wrapper<LineProcessItemQuery> queryWrapper);
}
